package hu.dynamicwebshop.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Szecskó Zoltán <zoltan.szecsko@gmail.com>
 */
@Entity()
@Table(name = "addresses")
public class Address {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "address_seq")
    @SequenceGenerator(name = "address_seq", sequenceName = "address_seq")
    @Column(name = "address_id", nullable = false)
    private int addressId;
    @ManyToOne
    @JoinColumn(name = "country_id", nullable = false)
    private Country country;
    @Column(name = "postal_code", nullable = false, length = 15)
    private String postalCode;
    @Column(name = "settlement", nullable = false, length = 50)
    private String settlement;
    @Column(name = "public_premises_name", nullable = false, length = 50)
    private String publicPremisesName;
    @Column(name = "house_number", nullable = false, length = 15)
    private String houseNumber;
    @Column(name = "storey_door", nullable = true, length = 15)
    private String storeyDoor;

    public int getAddressId() {
        return addressId;
    }

    public void setAddressId(int addressId) {
        this.addressId = addressId;
    }

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    public String getSettlement() {
        return settlement;
    }

    public void setSettlement(String settlement) {
        this.settlement = settlement;
    }

    public String getPublicPremisesName() {
        return publicPremisesName;
    }

    public void setPublicPremisesName(String publicPremisesName) {
        this.publicPremisesName = publicPremisesName;
    }

    public String getHouseNumber() {
        return houseNumber;
    }

    public void setHouseNumber(String houseNumber) {
        this.houseNumber = houseNumber;
    }

    public String getStoreyDoor() {
        return storeyDoor;
    }

    public void setStoreyDoor(String storeyDoor) {
        this.storeyDoor = storeyDoor;
    }

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }
}
